/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: 
 * License Type: Evaluation
 */
package cn.imvc.app.entities;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="menu")
public class Menu implements Serializable {
	public Menu() {
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="CN_IMVC_APP_ENTITIES_MENU_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="CN_IMVC_APP_ENTITIES_MENU_ID_GENERATOR", strategy="native")	
	private int id;
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Menu.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="parent_id", referencedColumnName="id") })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	private cn.imvc.app.entities.Menu parent;
	
	@Column(name="name", nullable=false, length=255)	
	private String name;
	
	@Column(name="url", nullable=false, length=255)	
	private String url;
	
	@Column(name="type", nullable=false, length=255)	
	private String type;
	
	@Column(name="title", nullable=true, length=255)	
	private String title;
	
	@Column(name="rel", nullable=false, length=255)	
	private String rel;
	
	@Column(name="width", nullable=true, length=10)	
	private Integer width;
	
	@Column(name="height", nullable=true, length=10)	
	private Integer height;
	
	@Column(name="minable", nullable=true, length=1)	
	private Boolean minable;
	
	@Column(name="mixable", nullable=true, length=1)	
	private Boolean mixable;
	
	@Column(name="resizable", nullable=true, length=1)	
	private Boolean resizable;
	
	@Column(name="drawable", nullable=true, length=1)	
	private Boolean drawable;
	
	@Column(name="fresh", nullable=true, length=1)	
	private Boolean fresh;
	
	@Column(name="close", nullable=true, length=1)	
	private Boolean close;
	
	@Column(name="param", nullable=true, length=1)	
	private Boolean param;
	
	@Column(name="external", nullable=true, length=1)	
	private Boolean external;
	
	@Column(name="remark", nullable=true, length=255)	
	private String remark;
	
	@Column(name="`order`", nullable=true, length=10)	
	private Integer order;
	
	@ManyToMany(targetEntity=cn.imvc.app.entities.Role.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@JoinTable(name="role_menu", joinColumns={ @JoinColumn(name="menuid") }, inverseJoinColumns={ @JoinColumn(name="roleid") })	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	private java.util.Set role = new java.util.HashSet();
	
	@OneToMany(mappedBy="parent", targetEntity=cn.imvc.app.entities.Menu.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	@OrderBy("order DESC,order DESC,id ASC")
	private java.util.Set menu = new java.util.HashSet();
	
	private void setId(int value) {
		this.id = value;
	}
	
	public int getId() {
		return id;
	}
	
	public int getORMID() {
		return getId();
	}
	
	public void setName(String value) {
		this.name = value;
	}
	
	public String getName() {
		return name;
	}
	
	public void setUrl(String value) {
		this.url = value;
	}
	
	public String getUrl() {
		return url;
	}
	
	public void setType(String value) {
		this.type = value;
	}
	
	public String getType() {
		return type;
	}
	
	public void setTitle(String value) {
		this.title = value;
	}
	
	public String getTitle() {
		return title;
	}
	
	public void setRel(String value) {
		this.rel = value;
	}
	
	public String getRel() {
		return rel;
	}
	
	public void setWidth(int value) {
		setWidth(new Integer(value));
	}
	
	public void setWidth(Integer value) {
		this.width = value;
	}
	
	public Integer getWidth() {
		return width;
	}
	
	public void setHeight(int value) {
		setHeight(new Integer(value));
	}
	
	public void setHeight(Integer value) {
		this.height = value;
	}
	
	public Integer getHeight() {
		return height;
	}
	
	public void setMinable(boolean value) {
		setMinable(new Boolean(value));
	}
	
	public void setMinable(Boolean value) {
		this.minable = value;
	}
	
	public Boolean getMinable() {
		return minable;
	}
	
	public void setMixable(boolean value) {
		setMixable(new Boolean(value));
	}
	
	public void setMixable(Boolean value) {
		this.mixable = value;
	}
	
	public Boolean getMixable() {
		return mixable;
	}
	
	public void setResizable(boolean value) {
		setResizable(new Boolean(value));
	}
	
	public void setResizable(Boolean value) {
		this.resizable = value;
	}
	
	public Boolean getResizable() {
		return resizable;
	}
	
	public void setDrawable(boolean value) {
		setDrawable(new Boolean(value));
	}
	
	public void setDrawable(Boolean value) {
		this.drawable = value;
	}
	
	public Boolean getDrawable() {
		return drawable;
	}
	
	public void setFresh(boolean value) {
		setFresh(new Boolean(value));
	}
	
	public void setFresh(Boolean value) {
		this.fresh = value;
	}
	
	public Boolean getFresh() {
		return fresh;
	}
	
	public void setClose(boolean value) {
		setClose(new Boolean(value));
	}
	
	public void setClose(Boolean value) {
		this.close = value;
	}
	
	public Boolean getClose() {
		return close;
	}
	
	public void setParam(boolean value) {
		setParam(new Boolean(value));
	}
	
	public void setParam(Boolean value) {
		this.param = value;
	}
	
	public Boolean getParam() {
		return param;
	}
	
	public void setExternal(boolean value) {
		setExternal(new Boolean(value));
	}
	
	public void setExternal(Boolean value) {
		this.external = value;
	}
	
	public Boolean getExternal() {
		return external;
	}
	
	public void setRemark(String value) {
		this.remark = value;
	}
	
	public String getRemark() {
		return remark;
	}
	
	public void setOrder(int value) {
		setOrder(new Integer(value));
	}
	
	public void setOrder(Integer value) {
		this.order = value;
	}
	
	public Integer getOrder() {
		return order;
	}
	
	public void setRole(java.util.Set value) {
		this.role = value;
	}
	
	public java.util.Set getRole() {
		return role;
	}
	
	
	public void setParent(cn.imvc.app.entities.Menu value) {
		this.parent = value;
	}
	
	public cn.imvc.app.entities.Menu getParent() {
		return parent;
	}
	
	public void setMenu(java.util.Set value) {
		this.menu = value;
	}
	
	public java.util.Set getMenu() {
		return menu;
	}
	
	
	public String toString() {
		return String.valueOf(getId());
	}
	
}
